unit u_pesquisaexcipiente;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, u_pesquisapadrao, FMTBcd, DB, DBClient, Provider, SqlExpr,
  ExtCtrls, AdvGlowButton, StdCtrls, Grids, DBGrids, JvExDBGrids, JvDBGrid,
  AdvEdit, AdvGroupBox;

type
  TFRM_PesquisaExcipiente = class(TFRM_PesquisaPadrao)
    cdsPesquisarCOD_EXCIPIENTE: TIntegerField;
    cdsPesquisarLIG_COD_PRODUTO: TIntegerField;
    cdsPesquisarPERC_DESCTO_VOLUME: TFMTBCDField;
    cdsPesquisarPRODUTO: TStringField;
    Panel1: TPanel;
    lblForma: TLabel;
    procedure FormShow(Sender: TObject);
    procedure edtPesquisarKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);

  public
    function PesquisarListaExcipiente(CodForma: integer): boolean;
  end;

var
  FRM_PesquisaExcipiente: TFRM_PesquisaExcipiente;

implementation

{$R *.dfm}

function TFRM_PesquisaExcipiente.PesquisarListaExcipiente(CodForma: integer): boolean;
begin
  cdsPesquisar.Close;
  sqlPesquisar.Params[0].AsInteger := CodForma;
  cdsPesquisar.Open;
  if cdsPesquisar.IsEmpty then Result := false else Result := true;
end;

procedure TFRM_PesquisaExcipiente.FormShow(Sender: TObject);
begin
  inherited;
  lblTotal.Caption := lblTotal.Caption + ' Excipientes ativos';
end;

procedure TFRM_PesquisaExcipiente.edtPesquisarKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
  inherited;
  cdsPesquisar.Locate('produto',edtPesquisar.Text,[loPartialKey,loCaseInsensitive]);
end;

end.
